package cn.msi.project.action;

import cn.common.action.GeneralAction;
import cn.msi.project.domain.Project;
import cn.msi.project.domain.ProjectProcess;
import cn.msi.project.service.ProjectService;

public class ProjectAction extends GeneralAction {

	private static final long serialVersionUID = -1011504426947862531L;

	private Project project = new Project();

	private ProjectProcess projectProcess = new ProjectProcess();

	private ProjectService projectService;

	/**
	 * 查询项目请求方法
	 * 
	 * @throws Exception
	 */
	public void searchProjectList() throws Exception {
		page(project);
		String json = projectService.searchProject(project);
		out(json);
	}

	/**
	 * 项目编辑界面
	 * 
	 * @return
	 * @throws Exception
	 */
	public String openProjectPage() throws Exception {
		project = projectService.findProject(project);
		return SUCCESS;
	}

	/**
	 * 保存项目
	 * 
	 * @throws Exception
	 */
	public void saveProject() throws Exception {
		projectService.saveProject(project);
	}

	/**
	 * 项目跟踪
	 * 
	 * @return
	 * @throws Exception
	 */
	public String processProject() throws Exception {
		project = projectService.findProject(project);
		return SUCCESS;
	}

	/**
	 * 项目查询列表
	 * 
	 * @throws Exception
	 */
	public void processList() throws Exception {
		page(projectProcess);
		String json = projectService.searchProcess(projectProcess);
		out(json);
	}

	/**
	 * 打开项目跟踪界面
	 * 
	 * @return
	 * @throws Exception
	 */
	public String openProjectProcess() throws Exception {
		return SUCCESS;
	}

	/**
	 * 保存项目跟进记录
	 * 
	 * @throws Exception
	 */
	public void saveProjectProcess() throws Exception {
		projectService.saveProjectProcess(projectProcess);
	}

	/**
	 * 项目指标管理界面
	 * 
	 * @return
	 * @throws Exception
	 */
	public String indexPage() throws Exception {
		project = projectService.findProject(project);
		return SUCCESS;
	}
	
	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public void setProjectService(ProjectService projectService) {
		this.projectService = projectService;
	}

	public ProjectProcess getProjectProcess() {
		return projectProcess;
	}

	public void setProjectProcess(ProjectProcess projectProcess) {
		this.projectProcess = projectProcess;
	}
}
